package com.young.springdemo.service.builderFactory;

public abstract class ActorBuilder {
    public Actor actor = new Actor();

    abstract void buildAge();

    abstract void buildName();

    abstract void buildHairStyle();

    abstract void buildFace();

    abstract void buildSex();

    public boolean isHair() {
        return false;
    }

    public Actor construct() {
        this.buildAge();
        this.buildFace();
        if (!isHair()) {
            this.buildHairStyle();
        }
        this.buildName();
        this.buildSex();
        return actor;
    }

}
